package com.yuke.cloud.service.uac.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.uac.dto.BindRoleDto;
import com.yuke.cloud.service.uac.dto.BindUserDto;
import com.yuke.cloud.service.uac.dto.UserRoleDto;
import com.yuke.cloud.service.uac.entity.AccUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AccUserRoleMapper extends MyMapper<AccUserRole> {
    List<UserRoleDto> selectUserRoleInfoByUserId(Long userId);

    /**
     * List super user list.
     *
     * @param roleId the role id
     *
     * @return the list
     */
    List<Long> listSuperUser(@Param("roleId") Long roleId);

    /**
     * Select all need bind user list.
     *
     * @param superManagerRoleId the super manager role id
     * @param currentUserId      the current user id
     *
     * @return the list
     */
    List<BindUserDto> selectAllNeedBindUser(@Param("superManagerRoleId") Long superManagerRoleId, @Param("currentUserId") Long currentUserId/*,  @Param("roleId") Long roleId*/);
    List<BindUserDto> selectAllNeedBindUserEx(@Param("superManagerRoleId") Long superManagerRoleId, @Param("currentUserId") Long currentUserId);
    List<BindUserDto> selectAllNeedBindUserExAdmin(@Param("adminUserId") Long adminUserId);

    /**
     * Delete exclude super mng int.
     *
     * @param currentRoleId the current role id
     * @param superRoleId   the super role id
     *
     * @return the int
     */
    int deleteExcludeSuperMng(@Param("currentRoleId") Long currentRoleId, @Param("superRoleId") Long superRoleId);

    /**
     * Select all need bind role list.
     *
     * @param superManagerRoleId the super manager role id
     *
     * @return the list
     */
    List<BindRoleDto> selectAllNeedBindRole(@Param("superManagerRoleId") Long superManagerRoleId);

    /**
     * 超级管理员角色也可以进行绑定
     * @return
     */
    List<BindRoleDto> selectAllNeedBindRoleEx();

    /**
     * List by user id list.
     *
     * @param userId the user id
     *
     * @return the list
     */
    List<AccUserRole> listByUserId(@Param("userId") Long userId);

    Integer checkAdminRoleByLoginName(@Param("adminRoleId") Long adminRoleId, @Param("loginName") String loginName);
}